package com.shop.common.service;

import com.bt.rpc.model.RpcResult;
import com.wy.tech.model.SendExam;
import com.wy.tech.model.TechBasic;
import com.wy.tech.rpc.CollegeRpc;
import org.springframework.stereotype.Service;

@Service
public class RpcServiceImpl implements CollegeRpc {
    /**
     * @param phone
     * @return
     */
    @Override
    public RpcResult<TechBasic> findPartner(String phone) {
        TechBasic techBasic = new TechBasic();
        techBasic.setId("053be81a4a8644c8a2b5b5ae1d552f90");
        techBasic.setName("TechName" + phone.substring(0, 4));
        return RpcResult.ok(techBasic);
    }

    /**
     * @param phone
     * @return
     */
    @Override
    public RpcResult<TechBasic> findTech(String phone) {
        return findPartner(phone);
    }

    /**
     * @param phone
     * @return
     */
    @Override
    public RpcResult<TechBasic> findHandiTech(String phone) {
        return findPartner(phone);
    }

    /**
     * @param req
     * @return
     */
    @Override
    public RpcResult<Boolean> sendPartnerExam(SendExam req) {
        return RpcResult.ok(true);
    }

    /**
     * @param req
     * @return
     */
    @Override
    public RpcResult<Boolean> sendTechExam(SendExam req) {
        return RpcResult.ok(true);
    }

    /**
     * @param url
     * @return
     */
    @Override
    public RpcResult<String> voice2text(String url) {
        return null;
    }
}
